package object3.package1;

public class Circle extends Shape{
    private int radius;   //半径

    public Circle() {
        super();
    }

    public Circle(int radius) {
        this.radius = radius;
        calcArea();
    }

    public int getRadius() {
        return radius;
    }

    public void setRadius(int radius) {
        this.radius = radius;
    }

    @Override
    public void draw() {
        System.out.println("●");
    }

    @Override
    public void calcArea() {
        area = pi * radius * radius;
    }

    @Override
    public String toString() {
        return "Circle{" +
                "radius=" + radius +
                ", area=" + area +
                '}';
    }
}
